<?php

//i) This is a special array that if something isn't set returns the key instead
//i) got for settings or languages because you can use it inside strings as default=>value
//ex) echo "{$lang['hi']}, $username";
//ex) echo "width: {$settings[100]}px"; 
//i) do you see the magic ... thanks to 

class DKArray Implements ArrayAccess{

		protected $array;
		
		function DKArray($array=array())
		{
			$this->array = $array;
		}
	 
		function offsetExists($offset){
			return isset($this->array[$offset]);
		}
	 
		function offsetGet($offset){
			if ($this->offsetExists($offset))
				return $this->array[$offset];
			else 
				return $offset;
		}
	 
		function offsetSet($offset, $value){
			if($offset){
				$this->array[$offset] = $value;
			}
			else{
				$this->array[] = $value;
			}
		}
	 
		function offsetUnset($offset){
			unset($array[$offset]);
		}
}